package Process;

public class NewRunnable {

    public static void main(String[] args) {
        //使用Runnable接口创建一个任务，在创建线程
        Runnable r = new Runnable() {
            @Override
            public void run() {
                System.out.println("我是runnable的线程");
            }
        };
        Thread t = new Thread(r);
        //以上合并的写法
        Thread tt = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("我是runnable合并thread的线程");
                while(true){
                }
            }
        },"tt");
        tt.start();
    }
}
